<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'findStaff.jsp' starting page</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript" src="<%=basePath%>manage/js/jquery.js"></script>
		<script type="text/javascript" src="manage/js/addbg.js"></script>
		<script language="javascript" type="text/javascript" src="<%=basePath%>datemaker/WdatePicker.js"></script>
		<link rel="stylesheet" type="text/css" href="manage/css/search.css"></link>
		<link rel="stylesheet" type="text/css" href="manage/css/tableBanner.css"></link>
		<link rel="stylesheet" type="text/css" href="manage/css/guanli.css"></link>
	</head>

		<body>
			<%
				String method = (String) request.getAttribute("method");
				if(method==null){
					method = "getAllStaff?" ;
				}
			%>
			<s:actionerror />
			<s:fielderror></s:fielderror>
			<s:iterator value="errorList">
				<s:property />
			</s:iterator>
	
	<h2 class="tableTitle">员工入职信息</h2>
		<table class="search">
		<tr>
			
					<form action="getStaff" methotd="post">
					<td>
						<input type="hidden" name="page.currentPage" value="1" />
						<strong>请输入查询条件：</strong>
						<input type="text" name="staffId" value="${staffId}"/>
						<input type="submit" value="查询" />
					</td>
					</form>
			
			
					<form action="getAllStaff" method="post">
					<td>
						<input type="hidden" name="page.currentPage" value="1" />
						<input type="submit" value="查询全部" />
					</td>
					</form>
			
			
					<form action="" method="post">
					<td>
						<input type="button" value="添加"
							onclick="window.location.assign('manage/staff/addStaff.jsp');" />
					</td>
					</form>
			
		</tr>
			</table>
			<%
				if (method.equals("personal")) {
			%>
			<form action="updateStaff" method="post">
				<s:iterator value="staffList">
					<s:hidden name="staff.staffId" value="%{staffId}"></s:hidden>
	
	<table class="cssrain">
		<tbody>
		<h2 class="bannerTitle">员工基本信息</h2>	
			<tr>
				<td>姓&nbsp;&nbsp;&nbsp;&nbsp;名</td>
				<td>
					<s:textfield name="staff.staffName" value="%{staffName}" />
				</td>
				<td>性&nbsp;&nbsp;&nbsp;&nbsp;别</td>
				<td>
					<s:textfield name="staffSex.staffSexName" />
				</td>
				<td rowspan="6">
					<img style="heght: 300px; width: 100px" src="${staffPhotoUrl}"><br/>相片
				</td>
				
			</tr>
			
			<tr>
				<td>曾用名</td>
				<td>
					<s:textfield name="staff.staffFormername"
								value="%{staffFormername}" />
				</td>
				<td>出生年月</td>
				<td>
					<s:textfield class="Wdate" onClick="WdatePicker()" name="staff.staffBirthday" value="%{staffBirthday}" />
				</td>
			</tr>

			
			<tr>
				<td>民&nbsp;&nbsp;&nbsp;&nbsp;族</td>
				<td>
					<s:textfield name="staff.staffNation" value="%{staffNation}" />
				</td>
				<td>出生地</td>
				<td>
					<s:textfield name="staff.staffBirthplace"
								value="%{staffBirthplace}" />
				</td>
			</tr>
			
			<tr>
				<td>政治面貌</td>
				<td>
					<s:textfield name="staff.staffPoliticsStatus"
								value="%{staffPoliticsStatus}" />
				</td>
				<td>联系电话</td>
				<td>
					<s:textfield name="staff.staffTel" value="%{staffTel}" />
				</td>
			</tr>
			
			<tr>
				
				<td>学&nbsp;&nbsp;&nbsp;&nbsp;历</td>
				<td>
					<s:textfield name="staff.staffEducation"
								value="%{staffEducation}" />
				</td>
				<td>身份证号码</td>
				<td>
					<s:textfield name="staff.staffIdnumber" value="%{staffIdnumber}" />
				</td>
			</tr>
			
			<tr>
				<td>现住址</td>
				<td>
					<s:textfield name="staff.staffAddress" value="%{staffAddress}" />
				</td>
				<td>邮&nbsp;&nbsp;&nbsp;&nbsp;编</td>
				<td>
					<s:textfield name="staff.staffZip" value="%{staffZip}" />
				</td>
			</tr>
			
			<tr>
				<td>毕业院校</td>
				<td>
					<s:textfield name="staff.staffGraduateSchool"
								value="%{staffGraduateSchool}" />
				</td>
				<td>籍&nbsp;&nbsp;&nbsp;&nbsp;贯</td>
				<td colspan="2">
					<s:textfield name="staff.staffNativePlace" size="50"
								value="%{staffNativePlace}" />
				</td>
			</tr>
		</tbody>
		</s:iterator>
	</table>
	<br/>
	<br/>
	<table class="cssrain">
	<h2 class="bannerTitle">员工入职信息</h2>
		<tbody>
		<tr>
			<td>员工姓名</td>
			<td>
				<s:property value="staffName" />
			</td>
			<td>身份证号码</td>
			<td colspan="2">
				<s:property value="staffIdnumber" />
			</td>
			
		</tr>
		
		<tr>
			<td>员工编号</td>
			<td>
				<s:property value="staffId" />
			</td>
			<td>入职部门</td>
			<td  colspan="2">
				<s:textfield name="staff.staffDepartment"
							value="%{staffDepartment}" />
			</td>
		</tr>
		
		<tr>
			<td>入职岗位</td>
			<td>
				<s:textfield name="staff.staffPost" value="%{staffPost}" />
			</td>

			<td>入职日期</td>
			<td colspan="2">
				<s:textfield name="staff.staffHiredate" class="Wdate" onClick="WdatePicker()" value="%{staffHiredate}" />
			</td>
		</tr>
	</tbody>
</table>
<br/>
<br/>
<!-- -    ------------------------------------------------ - -->
<table class="cssrain">
	<h2 class="bannerTitle">家庭主要成员</h2>
	<tbody>
		<tr>
			
			<td>姓&nbsp;&nbsp;&nbsp;&nbsp;名</td>
			<td>与本人关系</td>
			<td >现工作或学习单位(单位全称及所从事的工作)</td>
			<td>职&nbsp;&nbsp;&nbsp;&nbsp;务</td>
		</tr>
		<s:iterator value="familySet">
		<s:hidden name="staffFamilyId" value="%{staffFamilyId}"></s:hidden>
		<tr>
			<td>
				<s:textfield name="staffFamilyName" value="%{staffFamilyName}" />
			</td>
			<td>
				<s:textfield name="staffFamilyRelationship"
							value="%{staffFamilyRelationship}" />
			</td>
			<td>
				<s:textfield name="staffFamilyUnit" value="%{staffFamilyUnit}" />
			</td>
			<td>
				<s:textfield name="staffFamilyPost" value="%{staffFamilyPost}" />
			</td>
		</tr>
		</s:iterator>
	</tbody>
</table>
<br/>
<br/>	
<!-- ------------------------教育背景--------------------------- -->
<table class="cssrain">
	<h2 class="bannerTitle">教育背景</h2>
	<tbody>
		<tr>
			<td>时&nbsp;&nbsp;&nbsp;&nbsp;间</td>
			<td>所在院校</td>
			<td>证明人</td>
		</tr>
	<s:iterator value="educationSet">
	<s:hidden name="staffEducationId" value="%{staffEducationId}"></s:hidden>
		<tr>
			<td>
				<s:textfield name="staffEducationStart" class="Wdate" onClick="WdatePicker()"
							value="%{staffEducationStart}" />
							至
				<s:textfield name="staffEducationEnd" class="Wdate" onClick="WdatePicker()"
				value="%{staffEducationEnd}" />
			</td>
			<td>
				<s:textfield name="staffEducationSchool" 
							value="%{staffEducationSchool}" />
			</td>
			<td>
				<s:textfield name="staffEducationReference"
							value="%{staffEducationReference}" />
			</td>
		</tr>
	</s:iterator>
	</tbody>
</table>
<br />
<br />

<table class="cssrain">
	<h2 class="bannerTitle">工作经历</h2>
	<tbody>
			<tr>
				<td>
					时&nbsp;&nbsp;&nbsp;&nbsp;间
				</td>
				<td>
					所在单位
				</td>
				<td>
					职&nbsp;&nbsp;&nbsp;&nbsp;务
				</td>
			</tr>
		<s:iterator value="experienceSet">
		<s:hidden name="staffExperienceId" value="%{staffExperienceId}"></s:hidden>
			<tr>
				<td>
					<s:textfield name="staffExperienceStart" class="Wdate" onClick="WdatePicker()"
								value="%{staffExperienceStart}" />
								至
					<s:textfield name="staffExperienceEnd" class="Wdate" onClick="WdatePicker()"
										value="%{staffExperienceEnd}" />
				</td>
				<td>
					<s:textfield name="staffExperienceUnit"
								value="%{staffExperienceUnit}" />
				</td>
				<td>
					<s:textfield name="staffExperiencePost"
								value="%{staffExperiencePost}" />
				</td>
			</tr>
			</s:iterator>
	</tbody>
</table >
<br />
<br />
<table class="cssrain">
	<h2 class="bannerTitle">获得证书</h2>
	<tbody>

		<tr>
			<td>
				证书名称
			</td>
			<td>
				获得时间
			</td>
			<td>
				有效时间
			</td>
		</tr>
		<s:iterator value="certificateSet">
		<s:hidden name="staffCertificateId" value="%{staffCertificateId}"></s:hidden>
		<tr>
			<td>
				<s:textfield name="staffCertificateName"
							value="%{staffCertificateName}" />
			</td>
			<td>
				<s:textfield name="staffCertificateIssueDate" class="Wdate" onClick="WdatePicker()"
							value="%{staffCertificateIssueDate}" />
			</td>
			<td>
				<s:textfield name="staffCertificateNotbefore" class="Wdate" onClick="WdatePicker()"
							value="%{staffCertificateNotbefore}" />
								至
				<s:textfield name="staffCertificateNotafter" class="Wdate" onClick="WdatePicker()"
							value="%{staffCertificateNotafter}" />
			</td>
		</tr>
		</s:iterator>
</table>
<br/>
<center>
				<input type="submit" value="保存" />
				<input type="reset" value="重置" />
</center>
			</form>
			<%
				} 
				else {
			%>
			<table class="cssrain">
			<thead>
				<tr>
					<th>员工编号</th>
					<th>员工姓名</th>
					<th>身份证号码</th>
					<th>入职部门</th>
					<th>入职岗位</th>
					<th>入职日期</th>
					<th>政治面貌</th>
					<th>基本操作</th>
				</tr>
				</thead>
				<tbody>
				<s:if test="!staffList.isEmpty()">
					<s:iterator value="staffList">
					<tr>
						<td>
							<a href="showStaff?staffId=${staffId}">${staffId}</a>
						</td>
						<td>
							<s:property value="name" />
						</td>
						<td>
							<s:property value="idnumber" />
						</td>
						<td>
							<s:property value="department" />
						</td>
						<td>
							<s:property value="post" />
						</td>
						<td>
							<s:property value="hiredate" />
						</td>
						<td>
							<s:property value="politicsStatus" />
						</td>
						<td>
							<a href="deleteStaff?deleteId=${staffId}" onclick="return confirm('确定要删除吗？')">删除</a>
						</td>
					</tr>
			</s:iterator>
				</s:if>
				<s:else>
					<tr>
						<td colspan="8">没有记录</td>
					</tr>
				</s:else>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="8">
						<input type="button" class="firstPage"
							onclick="location.href='<%=method%>page.currentPage=1'"
							value="首页">
					
						<input type="button" class="frontPage"
							onclick="location.href='<%=method%>page.currentPage=${page.currentPage-1}'"
							value="上一页">
					
						<input type="button" class="secondPage"
							onclick="location.href='<%=method%>page.currentPage=${page.currentPage+1}'"
							value="下一页">
					
						<input type="button" class="lastPage"
							onclick="location.href='<%=method%>page.currentPage=${page.totalPages}'"
							value="末页">
					</td>
				</tr>
			</tfoot>
			</table>
			<%
				}
			%>
			<br />
			<br />
		</body>

</html>
